home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_11_09
/
1109060b
< prev
next >
Wrap
Text File
|
1993-07-06
|
613b
|
31 lines
// winstrm.cpp
#include "stdhdr.h"
#include "winstrm.h"
winstreambuf::winstreambuf ()
: streambuf (buffer, winstreambuf_buf_size)
{
*buffer = 0;
reset_buffer ();
stream_window = NULL;
}
int winstreambuf::sync ()
{
ASSERT (stream_window != NULL);
stream_window->PutText (pbase (), out_waiting ());
reset_buffer ();
return 0;
}
int winstreambuf::overflow (int nCh = EOF)
{
stream_window->PutText (pbase (), out_waiting ());
if (nCh != EOF)
// Ie nCh caused the overflow and must be output
stream_window->PutText ((char *) &nCh, 1);
reset_buffer ();
return 0;
}